import React from "react";
import routeWithUserSession from "@/components/ApplicationArea/routeWithUserSession";
import PageHeader from "@/components/PageHeader";

import "./Contract.css";
import LookToolbar from "@/components/contract/new/LookToolbar";
import routes from "@/services/routes";

class ContractLook extends React.Component {

  state = {
    items:[],//{
       id: "0",
    loading: true,
  };
  componentWillMount() {
    let id;
    if(this.props.id===undefined){
      id=0;
    }else{
      id=this.props.id;//this.props.location.state.id;
    }
      this.setState({
            id: id,
            loading: false,
      });
  }

  render() {
    if (this.state.loading ) return null;
    return (
        <div className="settings-screen">
          <div  style={{width:"400px",height:"40px"}}>
            <div style={{width:"20px",height:"38px", float: "left"}}>
            </div>
            <div style={{width:"50px",height:"38px", float: "left"}}>
              <img src="/static/images/contracts.png"/>
            </div>
            <div style={{width:"320px",height:"30px",float:"left"}}>
              <h3 style={{margin:"7px",padding:"0"}}>合同信息</h3>
            </div>
          </div>
        {/* <div className="container">
          <PageHeader title="合同信息" />
        </div> */}
            {/*// <div className="p-15">*/}
         <LookToolbar  id={this.state.id}/>
            {/*// </div>*/}
        </div>
      // // </div>
    );
  }
}

routes.register(
  "Contract.Look",
  routeWithUserSession({
    path: "/contract/look/:id",
    title: "合同信息",
    render: pageProps => <ContractLook {...pageProps}/>,
  })
);
// export default [
//   routeWithUserSession({
//     path: "/contract/look/:id",
//     title: "合同信息",
//     render: pageProps => <ContractLook {...pageProps} />,
//   }),
// ];
